﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CJJCH.Web
{
    public partial class DownLoad : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            string fullPath = "";
            if (Request.Params["returnUrl"] != null)
            {
                fullPath = Request.Params["returnUrl"].ToString();
            }
            if (String.IsNullOrEmpty(fullPath))
            {
                Response.Write("您访问的文件不存在");
                Response.End();
            }
            if (Request.Params["ID"] != null &&LTP.Common.CheckInput.CheckGUID(Request.Params["ID"].ToString()))
            {
                CJJCH.BLL.T_NET_Download bll_Download = new BLL.T_NET_Download();
                string error=bll_Download.EditDownHits(new Guid(Request.Params["ID"].Trim()));
                if (error=="")
                {
                    //Response.ContentType = "/doc";
                    //Response.AppendHeader("Content-Disposition", "attachment; filename=" + fullPath);
                    //Response.TransmitFile(Server.MapPath(fullPath));
                    //Response.End();

                    Response.Redirect(fullPath);
                    Response.End();
                }
                else
                {
                    Response.Write("文件访问失败！");
                    Response.End();
                }
            }

        }
    }
}
